import React from 'react';
import CreateProduct from './createProduct';
import {Table} from "antd";
import { useRequest } from 'umi';

export default () => {

  const init = useRequest('/api/product/list');
    return (
      <div>
        <CreateProduct
          refreshInit={init.run}
          name='新建产品'/>
        <Table
          dataSource={init?.data?.dataSource}
          columns={init?.data?.columns} />
      </div>
    );
}

